#include<stdio.h>

int main()
{
	double a,b,c,d,e,n,i;
	while (1)
	{
		scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
		if (a==0&&b==0&&c==0&&d==0&&e==0)
		{
			printf("End Of Input\n");
			break;
		}
		else
		{
			if(a+b+c+d+e==(a+e)*5/2.0&a!=b)
				printf("Arithmetic Progression\n");
			else if(a+b==c&&b+c==d&&c+d==e)
				printf("Fibonacci Sequence\n");
			else if(b/a==c/b&&c/b==d/c&&d/c==e/d&&b!=a)
				printf("Geometric Progression\n");
			else
				printf("Input Error\n");		
		}
	}
	return 0;
}
